package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.SysPintuanChildrenOrder;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.SysPintuanChildrenOrderMapper;
import com.ruoyi.system.service.ISysPintuanChildrenOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 小程序拼团订单子Service业务层处理
 *
 * @author zjw
 * @date 2023-08-29
 */
@Service
public class SysPintuanChildrenOrderServiceImpl implements ISysPintuanChildrenOrderService {
    @Resource
    private SysPintuanChildrenOrderMapper sysPintuanChildrenOrderMapper;

    /**
     * 查询小程序拼团订单子
     *
     * @param orderId 小程序拼团订单子主键
     * @return 小程序拼团订单子
     */
    @Override
    public SysPintuanChildrenOrder selectSysPintuanChildrenOrderByOrderId(String orderId) {
        return sysPintuanChildrenOrderMapper.selectSysPintuanChildrenOrderByOrderId(orderId);
    }

    /**
     * 查询小程序拼团订单子列表
     *
     * @param sysPintuanChildrenOrder 小程序拼团订单子
     * @return 小程序拼团订单子
     */
    @Override
    public List<SysPintuanChildrenOrder> selectSysPintuanChildrenOrderList(SysPintuanChildrenOrder sysPintuanChildrenOrder) {
        return sysPintuanChildrenOrderMapper.selectSysPintuanChildrenOrderList(sysPintuanChildrenOrder);
    }

    /**
     * 新增小程序拼团订单子
     *
     * @param sysPintuanChildrenOrder 小程序拼团订单子
     * @return 结果
     */
    @Override
    public int insertSysPintuanChildrenOrder(SysPintuanChildrenOrder sysPintuanChildrenOrder) {
        sysPintuanChildrenOrder.setCreateTime(DateUtils.getNowDate());
        return sysPintuanChildrenOrderMapper.insertSysPintuanChildrenOrder(sysPintuanChildrenOrder);
    }

    /**
     * 修改小程序拼团订单子
     *
     * @param sysPintuanChildrenOrder 小程序拼团订单子
     * @return 结果
     */
    @Override
    public int updateSysPintuanChildrenOrder(SysPintuanChildrenOrder sysPintuanChildrenOrder) {
        return sysPintuanChildrenOrderMapper.updateSysPintuanChildrenOrder(sysPintuanChildrenOrder);
    }

    /**
     * 批量删除小程序拼团订单子
     *
     * @param orderIds 需要删除的小程序拼团订单子主键
     * @return 结果
     */
    @Override
    public int deleteSysPintuanChildrenOrderByOrderIds(String[] orderIds) {
        return sysPintuanChildrenOrderMapper.deleteSysPintuanChildrenOrderByOrderIds(orderIds);
    }

    /**
     * 删除小程序拼团订单子信息
     *
     * @param orderId 小程序拼团订单子主键
     * @return 结果
     */
    @Override
    public int deleteSysPintuanChildrenOrderByOrderId(String orderId) {
        return sysPintuanChildrenOrderMapper.deleteSysPintuanChildrenOrderByOrderId(orderId);
    }

    @Override
    public SysPintuanChildrenOrder queryUnpaidOrder(Long userId) {
        return sysPintuanChildrenOrderMapper.queryUnpaidOrder(userId);
    }

    @Override
    public SysPintuanChildrenOrder queryToUseOrder(Long userId) {
        return sysPintuanChildrenOrderMapper.queryToUseOrder(userId);
    }

    @Override
    public SysPintuanChildrenOrder queryUsingOrder(Long userId) {
        return sysPintuanChildrenOrderMapper.queryUsingOrder(userId);
    }

    @Override
    public SysPintuanChildrenOrder queryGroupBookingOrderByUserId(Long userId) {
        return sysPintuanChildrenOrderMapper.queryGroupBookingOrderByUserId(userId);
    }

    @Override
    public List<SysPintuanChildrenOrder> queryGroupBookingSucceedOrder(Long userId) {
        return sysPintuanChildrenOrderMapper.queryGroupBookingSucceedOrder(userId);
    }

    @Override
    public List<SysPintuanChildrenOrder> queryGroupBookingFailedOrder(Long userId) {
        return sysPintuanChildrenOrderMapper.queryGroupBookingFailedOrder(userId);
    }
}
